﻿#include<iostream>
using namespace std;
int main() {
	char inKey{ 'y' };
	while (inKey == 'Y' || inKey == 'y') {
		int intIn;
		cout << "输入:";
		cin >> intIn;
		bool bcase{ intIn % 2 == 0 };//判断奇数偶数，奇数为false，偶数为true
		for (int i = 3; (!bcase) && (i <= sqrt(intIn)); i += 2) {
			if (intIn % i == 0) {
				bcase = true;
				break;
			}
		}
		if (bcase)cout << "不是质数" << endl;
		else cout << "质数" << endl;

		cout << "继续请输入y：";
		cin >> inKey;
		system("cls");
	}


}